package com.lujianfei.productprice.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.lujianfei.productprice.R;

public class BottomTotalCount extends RelativeLayout {

    TextView txtTotalCount;
    public BottomTotalCount(Context context) {
        super(context);
        init(context);
    }

    public BottomTotalCount(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context);
    }

    public BottomTotalCount(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context);
    }

    private void init(Context context) {
        LayoutInflater.from(context).inflate(R.layout.widget_bottom_count,this,true);
        txtTotalCount = findViewById(R.id.txtTotalCount);
    }

    public void setTotalCount(int totalCount){
        txtTotalCount.setText(String.format("一共 %s 条",totalCount));
    }
}
